package com.qimei.onerice.service.impl;

import com.qimei.onerice.dao.DishDao;
import com.qimei.onerice.dao.OrderDao;
import com.qimei.onerice.dao.impl.DishDaoImpl;
import com.qimei.onerice.dao.impl.OrderDaoImpl;
import com.qimei.onerice.entity.Dish;
import com.qimei.onerice.entity.Order;
import com.qimei.onerice.service.OrderService;

import java.util.List;

public class OrderServiceImpl implements OrderService {
	OrderDao orderDao = new OrderDaoImpl();

	@Override
	public List<Order> getOrderList() {
		return orderDao.getAllOrders();
	}

	@Override
	public boolean deleteOrder(int orderId) {
		int result = orderDao.deleteOrder(orderId);
		return result > 0;
	}

	@Override
	public boolean updateOrder(Order order) {
		int result = orderDao.updateOrder(order);
		return result > 0;
	}

	@Override
	public boolean addOrder(Order order) {
		int result = orderDao.addOrder(order);
		return result > 0;
	}

	@Override
	public Order getOrderById(int orderId) {
		return orderDao.getOrderById(orderId);
	}

	@Override
	public Order getCurrentOrder() {
		return orderDao.getCurrentOrder();
	}
}
